package com.qf.device.controller;
import com.qf.Dto.ResultData;
import com.qf.device.entity.Device;
import com.qf.device.entity.DeviceType;
import com.qf.device.mapper.DeviceMapper;
import com.qf.device.mapper.DeviceTypeMapper;
import com.qf.device.service.DeviceService;
import com.qf.device.service.DeviceTypeService;
import com.qf.device.service.impl.DeviceServiceImpl;
import com.qf.dto.PageDto;
import com.qf.vo.PageResult;
import com.qf.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 设备表 前端控制器
 * </p>
 *
 * @author zhu
 * @since 2023-10-26
 */
@RestController
@RequestMapping("/device")
@CrossOrigin
public class DeviceController {

    @Autowired
    private DeviceService deviceService;

    @Autowired
    private DeviceTypeService deviceTypeService;

    @PostMapping("/page")
    public PageResult<Device> page(@RequestBody PageDto<Device> pageDto){
        return deviceService.pageInfo(pageDto);
    }

    @GetMapping("type")
    public List<DeviceType> type(){
        return deviceTypeService.list();
    }



}
